CalcPlot is a combination RPN calculator and graphic plotter useful for viewing the variable interdependencies present in moderately complex equations. It was developed to learn about and utilize many of the Macintosh user interface features while at the same time achieving a tool which has been found quite useful in the types of engineering work that I do.
CalcPlot was developed using TML Pascal v2.0 from TML Systems, Melbourne, Fl together with MEWS (Menu, Event, and Window System) version 2.2 from the University of Minnesota.
CalcPlot permits you to enter an equation with parameters and constants, get single-point evaluations of the equation for a given value of the unknown, and then to plot the equation as a function of the unknown over a selected range and with a selectable plot design (tick marks, labels, etc.).
CalcPlot is a shareware project. Please make as many copies as you wish and give them to your friends, enemies, and co-workers. If you like and use it, send $10 to the author. You'll get an expanded User's Manual, be kept informed of updates to the program, and will be aiding the shareware concept.
Chapter I: INTRODUCTION
1.1 Getting Started
To begin, double-click the CalcPlot icon and you are shortly presented with the start-up screen which needs merely to be read before pulling down the 'CalcPlot Menu' and starting into serious work.
The items in this menu are as follows:
Revise Plot Layout
Revise Plot Formula
Plot Formula on New Layout
Plot Formula Over Previous Plot
Return to Start-up Screen
If you're a first time user, take a look at all these options and their corresponding figures. In the formal User's Manual (obtainable upon submittal of the shareware fee) we explain each one in some detail -- they are actually reasonably self-explanatory; CalcPlot can be used immediately; it was designed with the intent of being as obvious as possible in terms of what to do. However, some of the methods by which things are handled internally may have a bearing on how you wish to exploit it's detailed features; in such a case, the instructions are to be consulted.
1.2 The Commercial!
Pull down the Apple menu and selecting the 'About CalcPlot' item. This shows the original motivation for creating CalcPlot, the revision number and date of the version you are using, and a statement about the shareware nature of the effort. As you've heard many times before, the shareware method provides useful software for very little cost and is a perfect vehicle for trying software before you buy it. If you like it and find it useful, then pay for it -- this will produce more of the same. If you don't pay for it, more like it will not be produced!
[Another P.S. I very much would like your comments on this program whether you like it or not. Let me know (preferably by mail, though I'm in the phone book and on one or two bulletin boards) the features you would like to see expanded or deleted, places where it might be useful if introduced, etc.]
Chapter II: Revise Plot Layout
To design your own plot layouts, pull down the CalcPlot Menu and select 'Revise Plot Layout'. There are many items on this screen; the order in which you execute them is irrelevant.
Most of the items are relatively self-explanatory; explained here are only the more obscure.
2.1 First, Some General Comments
1. 'Cancel' will blank the screen and return all values in the Plot Design boxes to their values when the screen was opened.
2. 'OK' should be clicked when you are satisfied with the way things look and want to go to the formula page or see the resulting plot. Don't worry that every thing needs to be perfect; if it isn't, you be warned or will see the results.
3. The 'Return' key (or 'Carriage Return' key) and the 'Enter' key both act like the 'Tab' key: they transfer control to the next box. You thus don't have to use the mouse on each box when making many entries.
2.2 Rectangle
The four boxes in the upper right corner of the screen define the size and location of the plot rectangle to be drawn. The numbers are in
screen bits. The ones designated 'top' and 'left' define the top and left margins measured from the window edges (not the screen edges!). The 'height' and 'width' are then self-explanatory.
2.3 Ticks and Tick Labels (Values)
'Ticks' are, of course, the little short strokes that mark certain periodic points along each of the coordinate axes. How many there are, where they're placed, how they're labeled, and whether to use logarithmic or linear scaling is decided on these lines.
The axis (each is treatable independent of the other) length is divided into a number of periods, each of equal length. Each period is then further divided into sub-periods.
If logarithmic scaling is selected, then the sub-period number is ignored, the major periods are taken to be decades, and the minor ticks are spaced 2,3,4,5,6,7,8,9 as in a normal log plot.
Labels are applied to the major ticks on each axis. The labels must be specified, one per major tick plus one each for the end points, each separated by a comma. The first and last labels for each axis must be numbers. [Surprise: the other labels do not have to be!!] There must be exactly the same number of commas as there are major periods or an error box will appear when you click on OK.
Chapter III: Revise Plot Formula
To construct your own plot formulas, pull down the CalcPlot Menu and select the 'Revise Plot Formula' item. There are three principal regions on the displayed screen: most of the screen is like a calculator (RPN, 8-level stack) keyboard in which you click the mouse to produce symbols, the area along the right side is a ten-slot memory, and the large box near the bottom is where the formula is constructed.
Comments about 'Cancel', 'OK', and 'Return/Enter/Tab' are similar to those discussed before in connection with the 'Revise Plot Layout' screen.
3.1 RPN Keyboard
The entire upper left portion of the screen (except for the title line) is a series of 'keys' which can be clicked on to make them appear in the 'y =' box. This includes the row 'x' over to 'M0' down to the row 'New' over to 'M9'. As you click on each of these in turn, their characters appear in the equation box, usually preceeded by a comma.
Most of the keys are obvious in what they are supposed to do; below we separately discuss those which could couse some problems.
x - This represents the independent variable and the horizontal axis of the plot. Typically, you want to plot y against x or to evaluate y as a function of x.
pi, e, c, h, k, q - These are all mathematical or physical constants which may be useful in some calculations. The values used for these constants are as follows:
pi = 3.14159265358979323846
e = 2.71828182845904523536
c = 2.9979250e+10 cm/sec (velocity of light in a vacuum)
h = 6.6260755e-34 joul-sec (Planck's constant)
k = 1.38062e-23 jouls/degree-K (Boltzmann's constant)
q = 1.602192e-19 coul (electronic charge)
New - This button is used to start over. It will blank the equation box and all 10 of the memory slots.
Enter - This is a "push" in stack notation.
Rotate - This causes the top of the stack to go to the bottom and all other registers to move towards the top.
Store.., Retrieve.. - These store to and retrieve from the 10 memory slots. To designate which slot, one also clicks on the desired M-number immediately after clicking on either the Store or Retrieve keys. Store leaves the stack unchanged.
3.2 Memory Slots
These can contain constants of your own choosing or can be used to store intermediate results. Of course, you can also enter constants directly into the equation box via the keyboard.
The allowable forms of the useful numbers in CalcPlot are wide. The following examples should suffice: 35, -15.6, +.45e-10, 16E.56, -.678e-1.567, 2.3471E-45. Plus signs (+) are not needed, fractional powers of 10 are OK, 'e' and 'E' are both allowed, even spaces are allowed.
3.3 Equation Box
Here is where the equation is constructed and edited. Commas are used to separate (delineate) the steps of the calculation.
All or parts of the equation can also be entered from the Macintosh keyboard. Just click the cursor where you wish to start and begin typing (remember to put in the commas!). Also, the regular Macintosh Cut/Copy/Paste commands are operable. Numbers can also be entered in this manner.
3.4 Formula Error
When you click on 'OK' or 'Single Evaluation', the formula is surveyed to see if all symbols are decipherable. If not, an error box is displayed. You then must locate the offending portion of the equation and correct it. The error checking is very simple: only the symbols themselves are tested, not their sequence.
3.5 Single Evaluation
Click this to obtain a numerical evaluation of the entered formula. Enter a value for the independent variable; a CR (or a click on the 'Compute y' button) will cause the result to be displayed.
3.8 Computational Errors
During a 'Single Evaluation' or during a plotting sequence, six types of computational error are captured by CalcPlot and flagged for correction by the user:
(a) zero times infinity,
(b) zero divided by zero,
(c) square root of a negative number,
(d) log or ln of a negative number,
(e) a negative number raised to a power, and
(f) arcsine or arccosine of a number whose absolute value exceeds unity.
Note that infinity (one divided by zero, the tangent of pi/2, etc.) is an allowed number. It will show as 'INF' during a 'Single Evaluation' calculation or will go off the screen during a plot.
Chapter IV: Generating the Plot
Pulling down the CalcPlot Menu and selecting the 'Plot Formula on New Layout' item produces a screen which displays the final result of all your efforts and takes place with no intervention on your part. Thus, you don't do anything to this screen except enjoy it.
[If a calculational error occurs during plotting, an error dialog appears; clicking the OK box then terminates the plot by having the line jump to the top. This is presumably a real error, not one to be kept, and hence no attempt is made to reconstruct the screen.]
All the time these things are going on, the 'wait cursor' is being displayed (it can be moved around if you want, but nothing will happen if you click). When the plot is completed, the cursor changes to its normal arrow form and the menus can again be selected.
The plot window (or any of the windows displayed) can immediately be printed by a 'command-shift-4' keyboard press or can be put to memory (disk) with a 'command-shift-3' sequence (if you want to make a MacPaint document out of it).
Execution using the Plot Formula Over Previous Plot command will do just that; it will put up the old plot (quickly) and then proceed to compute and put up the (presumably) new equation. Be careful not to move the plot box around or redo the ticks; the old plot does things in screen coordinates while the new one pays attention to the plot design items.
Appendix: List of Known Deficiencies
There is no such thing as the perfect or finished program. This one is no exception. Following are a few items which I hope one day (Real soon now!) to incorporate into CalcPlot or to correct. You will probably discover others. Let me know and I will at least add them to the list.
1. The log mode for axes ticks can only handle decades. This is a sticky problem but very annoying. High on my priority list.
2. The major tick marks are equally spaced regardless of the tick labels (values). This does not seem to be serious, but could be an annoyance in certain cases. (Numbers 1 and 2 indicate that the entire tick handling proceedure needs to be redesigned.)
3. No help screens.
4. There is no ability to save to disk those formulae and plot designs which you like or use often; they must be created each time you power up. This is especially annoying when you need to switch back and forth between two or more well-used forms. The current rationale is that CalcPlot is meant for those problems which are relatively small and hence of the 'throwaway' variety. If you use CalcPlot a lot, that might not be true.
5. Only RPN calculations are presently handled. It might be nice to allow algebraic notation also. Perhaps one should have a BASIC-like screen into which small progams can be entered, ultimately with the result that 'y' is plotted as a function of 'x'.
6. Contour plots (multi-valued functions of x) are not permitted and perhaps will never be.
P.S. A 3-D version is in the works; i.e. z = f(x,y).